package com.fh.util;


public class TimeUtil {
	public static String codingTime(int time)
	{
		if (time < 60) {
			return String.format("%.2f", time / (float)1 ) + " S";
		}else if (time >= 60 && time < 60 * 60 ) {
			return String.format("%.2f", time / (float)60 ) + " M"; 
		}else if (time >= 60 * 60) {
			return String.format("%.2f", time / 60 / (float)60) + " H";
		}else {
			return "Error";
		}
	}
	
	
	public static void main(String[] args) {
		double time = 125 / (float)60;
		System.out.println(String.format("%.2f", time));
		
		System.out.println(codingTime(59));
		System.out.println(codingTime(90));
		System.out.println(codingTime(3800));
	}
}
